package com.headfirst.BehaviorMode.command.remote.version2;

import com.headfirst.BehaviorMode.command.remote.version2.equipment.CeilingFan;

public class RemoteLoader {

    public static void main(String[] args) {
        //RemoteControlWithUndo remoteControlWithUndo = new RemoteControlWithUndo();
        //
        //Light livingRoomLight = new Light("living room");
        //
        //LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight);
        //LightOffCommand livingRoomLightOff = new LightOffCommand(livingRoomLight);
        //
        //remoteControlWithUndo.setCommands(0, livingRoomLightOn, livingRoomLightOff);
        //
        //remoteControlWithUndo.onButtonWasPushed(0);
        //remoteControlWithUndo.offButtonWasPushed(0);
        //System.out.println(remoteControlWithUndo);
        //remoteControlWithUndo.undoCommandWasPushed();
        //remoteControlWithUndo.offButtonWasPushed(0);
        //remoteControlWithUndo.onButtonWasPushed(0);
        //System.out.println(remoteControlWithUndo);
        //remoteControlWithUndo.undoCommandWasPushed();
        
        test();
        
    }
    
    public static void test(){
        RemoteControlWithUndo remoteControlWithUndo = new RemoteControlWithUndo();

        CeilingFan livingRoomCeilingFan = new CeilingFan("Living Room");

        CeilingFanMediumCommand ceilingFanMediumCommand = new CeilingFanMediumCommand(livingRoomCeilingFan);
        CeilingFanHighCommand ceilingFanHighCommand = new CeilingFanHighCommand(livingRoomCeilingFan);
        CeilingFanOffCommand ceilingFanOffCommand = new CeilingFanOffCommand(livingRoomCeilingFan);
        
        remoteControlWithUndo.setCommands(0, ceilingFanMediumCommand, ceilingFanOffCommand);
        remoteControlWithUndo.setCommands(1, ceilingFanHighCommand, ceilingFanOffCommand);
        
        remoteControlWithUndo.onButtonWasPushed(0);
        remoteControlWithUndo.offButtonWasPushed(0);
        System.out.println(remoteControlWithUndo);
        remoteControlWithUndo.undoCommandWasPushed();
        
        remoteControlWithUndo.onButtonWasPushed(1);
        System.out.println(remoteControlWithUndo);
        remoteControlWithUndo.undoCommandWasPushed();

    }
    
    
}
